<?php

namespace app\site\service\store;

use app\model\store\GoodsReply;
use JetBrains\PhpStorm\Pure;
use think\db\Query;

class GoodsReplyService extends \app\site\service\SiteBaseService
{

    function initialize()
    {
        $this->model = new GoodsReply();
    }

    function formatData(array $data): array
    {
        if ($data['images']??'' && is_array($data['images'])){
            $data['images'] = miImplode($data['images']);
        }
        return $data;
    }

    function query(): Query
    {
        return $this->setWith(['goods', 'saleOrder'])->makeQuery()->filter(function ($v){
            $v->imageArr = miExplode($v->images);
        });
    }



}
